import java.util.Arrays;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        while (true) {
            int n = in.nextInt();
            int m = in.nextInt();
            if (n==0&m==0){
                break;
            }
            int[] a = new int[n + 1];
            for (int i = 0; i < n; i++) {
                a[i] = in.nextInt();
            }
            a[n] = m;
            Arrays.sort(a);
            int cut = 0;
            for (int i = 0; i <= n; i++) {
                if (cut == 0) {
                    System.out.print(a[i]);
                    cut++;
                } else {
                    System.out.print(" " + a[i]);
                }
            }
            System.out.println();
        }
    }
}

